#import "Common.h"
#import "DataType.h"
#import "LayerHelp.h"
#import "LayerMainMenu.h"
#import "BtnGold.h"

@implementation SceneHelp

-(id) init
{
	if ((self = [super init]))
		[self addChild:[LayerHelp node]];
	return self;
}

@end

@implementation LayerHelp

-(id)init
{
	if ((self = [super init])) {
		CCSprite* help = [CCSprite spriteWithFile:@"help.png"];
		help.position = gPointCenter;
		[self addChild:help];
		
		CCMenuItemImage* menuItem = [CCMenuItemImage itemFromNormalImage:@"btn-02.png"
														   selectedImage:@"btn-02-s.png"
																  target:self
																selector:@selector(callMenu)];
									 
		menuItem.position = ccp(70,30);
		CCLabelTTF* label = [CCLabelTTF labelWithString:NSLocalizedString(@"BtnClose",nil) fontName:gFontName fontSize:16];
		label.position = ccp(menuItem.contentSize.width/2,menuItem.contentSize.height/2+2);
		[menuItem addChild:label];
		
		CCMenu* menu = [CCMenu menuWithItems:menuItem,nil];
		menu.position = CGPointZero;
		[self addChild:menu];
	}
	return self;
}

-(void)callMenu
{
	[[SimpleAudioEngine sharedEngine] playEffect:SOUND_BTN01];
	
	[[CCDirector sharedDirector] replaceScene:
	 [CCTransitionFade transitionWithDuration:0.5 scene:[SceneMainMenu node]]];
}

@end
